package org.zanateh.wargame.game.moveevaluators;

import org.zanateh.wargame.game.piece.Piece;

public abstract class MoveEvaluator implements IMoveEvaluator {

	Piece mPiece = null;
	
	@Override
	public void onAddEvaluator(Piece pPiece) {
		mPiece = pPiece;		
	}
	
	protected Piece getAttachedPiece()
	{
		return mPiece;
	}

	@Override
	public boolean allowAnotherPieceMove(Piece pPiece) {
		if( pPiece == mPiece ) {
			throw new IllegalArgumentException("Cannot call allowAnotherPieceMove on the same piece!");
		}
		return true;
	}
}
